Skip to content

ref(normalization): Use deprecation-aware accessors for DB normalization - #6560

Draft
mjq wants to merge 1 commit into
mjq/deprecated-attribute-accessorfrom
mjq/deprecated-attribute-accessor-2-db-normalization
Draft

mjq wants to merge 1 commit into
mjq/deprecated-attribute-accessorfrom
mjq/deprecated-attribute-accessor-2-db-normalization

Conversation

@mjq

@mjq mjq commented Oct 26, 2026

Copy link
Copy Markdown
Member

Use deprecation-aware getters in database attribute normalization, and test the deprecation behaviour. See the first commit in the stack for the background.


Stack created with GitHub Stacks CLI • Give Feedback 💬

Update database attribute normalization to use deprecation-aware accessors. See
the head of the stack for details.
@mjq
mjq added this pull request to stack #6561 October 26, 2026 17:50
@mjq
mjq requested a review from a team as a code owner October 26, 2026 17:50
@mjq
mjq marked this pull request as draft October 26, 2026 17:51
@vjeranc

vjeranc commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

These predate this PR but are on this path (#6519 has more bugs of similar nature). Could we cover/fix these and check that ordering doesn't bypass the deprecation-aware logic?

1. Name normalization discards the fallback before lookup
Input:
  db.system = {"type":"string","value":"mysql"}
  db.query.text = {"type":"string","value":42}
  db.statement = {"type":"string","value":"SELECT \"not an identifier\""}
sentry.normalized_db_query: actual=missing, expected="SELECT %s"

2. DB domain shadowed by server address
Input: db.system.name="mongodb", db.operation.name="find",
       db.query.text='{"find":"users"}', db.collection.name="users",
       server.address="mongo.example.com"
sentry.domain: actual="mongo.example.com", expected=",users,"

3. Query marker skips operation/collection normalization
Input: db.system.name="mongodb", db.operation.name="find",
       db.collection.name="documents_a1b2c3d4",
       sentry.normalized_db_query='{"find":"documents_{%s}"}'
sentry.action: actual="find", expected="FIND"
sentry.domain: actual=",documents_a1b2c3d4,", expected=",documents_{%s},"

4. Description synthesized after DB normalization
Input: span.name="SELECT * FROM users WHERE id = 42",
       sentry.op="db", sentry.origin="manual", db.system.name="mysql"
sentry.normalized_db_query:
  actual=missing, expected="SELECT * FROM users WHERE id = %s"

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants